<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="${path}/css/public.css" />
    <link rel="stylesheet"
          href="${path}/css/themes/base/jquery.ui.all.css">
    <link rel="stylesheet" href="${path}/js/demos.css">

    <script type="text/javascript"
            src="${path}/js/jquery-1.7.2.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.core.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.widget.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.position.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.autocomplete.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.datepicker.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.datepicker-zh-CN.js"></script>
    <script src="${path}/js/jquery.ui.button.js"></script>
    <link rel="stylesheet" href="${path}/css/icons.css">
    <script src="${path}/js/icons.js"></script>


    <title>客户冲突</title>
</head>
<body>
<!--头部-->
<div class="header">

    <div class="top">
        <div class="top_left">
            <span class="f1">欢迎您：ADMIN</span>
        </div>
        <div class="top_right">
            <a href="../index.html" class="top_ico0">首页</a>
            <a href="../../initUpdatePassword.action" class="top_ico1">修改密码</a>
            <a href="../../user/initPersonalInfo.action" class="top_ico2">个人信息</a>
            <a href="../../logout.action" class="top_ico3">退出</a>
        </div>
    </div>
    <div class="top2">
        <p class="pro_id">客户关系管理系统 v2.0</p>
    </div>
</div>

<!--主体-->
<table class="main" border="0"
       style="width: 100%; background-color: #FFFFFF">
    <tr>
        <td width="140" style="vertical-align: top;">
            <div class="main_left">



                <script type="text/javascript" src="${path}/js/jquery.ui.accordion.js"></script>

                <script type="text/javascript">
                    $().ready(function() {
                        $('.menuTitle').click(function() {//添加menuTitle的click事件
                            if ($(this).next().is(":hidden")) {//隐藏判断
                                $('.menu_ul_div').slideUp();//隐藏 */
                                $(this).next().slideDown();//显示
                            } else {
                                if ($(this).next().attr("id") == 'menu_ul_div_1') {

                                    $('.menu_ul_div').slideUp();//隐藏 */
                                    $('#menu_ul_div_2').slideDown();//显示

                                }
                                ;
                                if ($(this).next().attr("id") == 'menu_ul_div_2') {

                                    $('.menu_ul_div').slideUp();//隐藏 */
                                    $('#menu_ul_div_3').slideDown();//显示

                                }
                                ;
                                if ($(this).next().attr("id") == 'menu_ul_div_3') {

                                    $('.menu_ul_div').slideUp();//隐藏 */
                                    $('#menu_ul_div_4').slideDown();//显示

                                }
                                if ($(this).next().attr("id") == 'menu_ul_div_4') {

                                    $('.menu_ul_div').slideUp();//隐藏 */
                                    $('#menu_ul_div_1').slideDown();//显示

                                }
                            }
                        });
                    });
                </script>
                <div class="sidebar">

                    <h2 id="menu1" class="menuTitle">客户管理</h2>
                    <div class="menu_ul_div" id="menu_ul_div_1"
                         style="display:block;"
                    >
                        <ul id="menu1_ul" class="menu_ul">
                            <li class="menuItem"><a href="${path}/customer/initConflict">客户冲突</a></li>
                            <li class="menuItem"><a href="${path}/customer/initAdd.action">添加客户</a></li>
                            <li class="menuItem"><a href="${path}/customer/initServe.action">服务中签约客户</a></li>
                            <li class="menuItem"><a href="${path}/customer/initNoServe.action">未签约客户</a></li>
                            <li class="menuItem"><a href="${path}/customer/initNoServeFirst.action">未签约-已初试</a></li>
                            <li class="menuItem"><a href="${path}/customer/initNoServeSecond.action">未签约-已复试</a></li>
                            <li class="menuItem"><a href="${path}/customer/getAllSea.action">公海客户</a></li>
                            <li class="menuItem"><a href="${path}/visitRecord/initSearch.action">拜访查询</a></li>
                        </ul>
                    </div>


                    <h2 id="menu2" class="menuTitle">合同管理</h2>
                    <div class="menu_ul_div" id="menu_ul_div_2"

                         style="display:none;">
                        <ul id="menu2_ul" class="menu_ul">
                            <li class="menuItem"><a href="../../contractTemplate/initList.action">合同模版</a></li>
                            <li class="menuItem"><a href="../../contract/initAdd.action">新增合同</a></li>
                            <li class="menuItem"><a href="../../contract/initContractValid.action">有效合同查询</a></li>
                            <li class="menuItem"><a href="../../contract/initContractInvalid.action">无效合同查询</a></li>
                            <li class="menuItem"><a href="../../contract/initPaymentReceivable.action">应收款查询</a></li>
                            <li class="menuItem"><a href="../../contract/initPaymentReceived.action">到款查询</a></li>
                        </ul>
                    </div>


                    <h2 id="menu3" class="menuTitle">报表管理</h2>
                    <div class="menu_ul_div" id="menu_ul_div_3"

                         style="display:none;">
                        <ul id="menu3_ul" class="menu_ul">
                            <li class="menuItem"><a href="../../report/initReport.action">拜访量报表</a></li>
                        </ul>
                    </div>


                    <h2 id="menu4" class="menuTitle">系统设置</h2>
                    <div class="menu_ul_div" id="menu_ul_div_4"

                         style="display:none;">
                        <ul id="menu4_ul" class="menu_ul">
                            <li class="menuItem"><a href="../../system/search.action">员工设置</a></li>
                            <li class="menuItem"><a href="../../announcement/search.action">公告管理</a></li>
                            <li class="menuItem"><a href="../../system/elses.action">其他设置</a></li>
                        </ul>
                    </div>

                </div>
            </div>
        </td>
        <td style="vertical-align: top;">
            <div class="main_right">



                <link rel="stylesheet" href="${path}/css/themes/base/jquery.ui.all.css">
                <script src="${path}/js/jquery.ui.button.js"></script>
                <link rel="stylesheet" href="${path}/css/demos.css">
                <link rel="stylesheet" href="${path}/css/icons.css">

                <script src="${path}/js/icons.js"></script>
                <script type="text/javascript">

                    var cityId = "";


                    function submitForm(){
                        document.getElementById("pageNumber").value = 1;
                        document.myForm.submit();
                    }


                    function loadCity(){
                        var provId = $("#prov").val();
                        //判断是请选择以外....
                        if(provId != null && ""!=provId){
                            $.ajax({
                                type:"post",
                                //请求路径
                                url:"${path}/customer/ajaxCityFromProv",
                                //请求格式
                                dataType:"json",
                                //提交的数据
                                data:{"provId":provId},
                                //处理错误
                                error:function(){
                                    alert("请求处理失败");
                                },
                                //处理成功
                                success:function(result){
                                    var citys = result;
                                    var cityName = $("#customerCityName").val();
                                    $("#city").empty();//清空所有原选项

                                    $("#city").append("<option value='' selected='selected'>==下级市/区==</option>");

                                    $(citys).each(function(){
                                        if(cityName == this.name){
                                            $("#city").append("<option value='"+this.id+"' selected>"+this.name+"</option>");
                                        }else{
                                            $("#city").append("<option value='"+this.id+"'>"+this.name+"</option>");
                                        }
                                    });

                                    //初始化已选城市
                                    if(cityId != ""){
                                        $("#city").val(cityId);
                                    }
                                }
                            });
                        }else{
                            $("#city").empty();//清空所有原选项
                            $("#city").append("<option value='' selected='selected'>==下级市/区==</option>");

                        }
                    }

                    $(function(){

                        //初始化城市下拉菜单
                        loadCity();

                        //监听change事件
                        $("#prov").change(function(){
                            loadCity();
                        });

                    });
                </script>

                <div class="main">
                    <div class="content">
                        <div class="pageHead">
                            <table>
                                <tr>
                                    <th width="8"><img src="${path}/images/c_l.gif" height="31" width="8"/></th>
                                    <th align="left" class="title_area">当前位置：客户管理 &gt; 客户冲突</th>
                                    <th width="9"><img src="${path}/images/c_r.gif" height="31" width="9"></th>
                                </tr>
                            </table>
                        </div>
                        <div class="pageBody">
                            <ul class="errorMessage">
                                <li><span>查询条件不能为空!至少一个条件</span></li>	</ul>

                            <form id="conflict" name="myForm" action="${path}/customer/conflict" method="post">
                                <input type="hidden" name="pager.pageNumber" value="1" id="pageNumber"/>
                                <table class="mytable fullWidth">
                                    <tr>
                                        <th>客户名称</th>
                                        <td>
                                            <input type="text" name="customer.name" value="${contact.customer.name}" id="conflict_contact_customer_name"/>
                                        </td>
                                        <th>客户地址</th>
                                        <td>
                                            <input type="text" name="customer.address" value="${contact.customer.address}" id="conflict_contact_customer_address"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>固定电话</th>
                                        <td>
                                            <input type="text" name="phone" value="${contact.phone}" id="conflict_contact_phone"/>
                                        </td>
                                        <th>手机</th>
                                        <td>
                                            <input type="text" name="mobilePhone" value="${contact.mobilePhone}" id="conflict_contact_mobilePhone"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>主联系人</th>
                                        <td>
                                            <input type="text" name="name" value="${contact.name}" id="conflict_contact_name"/>
                                        </td>
                                        <th>地区信息</th>
                                        <td>
                                            <select name="provinceId" id="prov" style="width:128px">
                                                <option value=""
                                                        selected="selected"
                                                >==选择省/直辖市==</option>
                                                <option value="45448e0c-c979-48f6-830b-fe5c80e0b1a4" <c:if test="${contact.customer.provinceName=='上海市'}">selected</c:if> >上海市</option>
                                                <option value="8a279a2d-2204-47aa-bd8f-7d022d32b1bf" <c:if test="${contact.customer.provinceName=='云南省'}">selected</c:if>>云南省</option>
                                                <option value="2df89fa6-35a3-4d62-bdad-5ca932ec8742" <c:if test="${contact.customer.provinceName=='内蒙古'}">selected</c:if>>内蒙古</option>
                                                <option value="北京市" <c:if test="${contact.customer.provinceName=='北京市'}">selected</c:if>>北京市</option>
                                                <option value="吉林省" <c:if test="${contact.customer.provinceName=='吉林省'}">selected</c:if>>吉林省</option>
                                                <option value="四川省" <c:if test="${contact.customer.provinceName=='四川省'}">selected</c:if>>四川省</option>
                                                <option value="天津市" <c:if test="${contact.customer.provinceName=='天津市'}">selected</c:if>>天津市</option>
                                                <option value="宁 夏" <c:if test="${contact.customer.provinceName=='宁 夏'}">selected</c:if>>宁 夏</option>
                                                <option value="安徽省" <c:if test="${contact.customer.provinceName=='安徽省'}">selected</c:if>>安徽省</option>
                                                <option value="山东省" <c:if test="${contact.customer.provinceName=='山东省'}">selected</c:if>>山东省</option>
                                                <option value="山西省" <c:if test="${contact.customer.provinceName=='山西省'}">selected</c:if>>山西省</option>
                                                <option value="广 西" <c:if test="${contact.customer.provinceName=='广 西'}">selected</c:if>>广 西</option>
                                                <option value="广东省" <c:if test="${contact.customer.provinceName=='广东省'}">selected</c:if>>广东省</option>
                                                <option value="新 疆" <c:if test="${contact.customer.provinceName=='新 疆'}">selected</c:if>>新 疆</option>
                                                <option value="江苏省" <c:if test="${contact.customer.provinceName=='江苏省'}">selected</c:if>>江苏省</option>
                                                <option value="江西省" <c:if test="${contact.customer.provinceName=='江西省'}">selected</c:if>>江西省</option>
                                                <option value="河北省" <c:if test="${contact.customer.provinceName=='河北省'}">selected</c:if>>河北省</option>
                                                <option value="河南省" <c:if test="${contact.customer.provinceName=='河南省'}">selected</c:if>>河南省</option>
                                                <option value="浙江省" <c:if test="${contact.customer.provinceName=='浙江省'}">selected</c:if>>浙江省</option>
                                                <option value="海南省" <c:if test="${contact.customer.provinceName=='海南省'}">selected</c:if>>海南省</option>
                                                <option value="湖北省" <c:if test="${contact.customer.provinceName=='湖北省'}">selected</c:if>>湖北省</option>
                                                <option value="湖南省" <c:if test="${contact.customer.provinceName=='湖南省'}">selected</c:if>>湖南省</option>
                                                <option value="甘肃省" <c:if test="${contact.customer.provinceName=='甘肃省'}">selected</c:if>>甘肃省</option>
                                                <option value="福建省" <c:if test="${contact.customer.provinceName=='福建省'}">selected</c:if>>福建省</option>
                                                <option value="西 藏" <c:if test="${contact.customer.provinceName=='西 藏'}">selected</c:if>>西 藏</option>
                                                <option value="贵州省" <c:if test="${contact.customer.provinceName=='贵州省'}">selected</c:if>>贵州省</option>
                                                <option value="辽宁省" <c:if test="${contact.customer.provinceName=='辽宁省'}">selected</c:if>>辽宁省</option>
                                                <option value="重庆市" <c:if test="${contact.customer.provinceName=='重庆市'}">selected</c:if>>重庆市</option>
                                                <option value="陕西省" <c:if test="${contact.customer.provinceName=='陕西省'}">selected</c:if>>陕西省</option>
                                                <option value="青海省" <c:if test="${contact.customer.provinceName=='青海省'}">selected</c:if>>青海省</option>
                                                <option value="黑龙江" <c:if test="${contact.customer.provinceName=='黑龙江'}">selected</c:if>>黑龙江</option>


                                            </select>

                                            <input id="customerCityName" type="hidden" value="${contact.customer.cityName}">
                                            <select id="city" name="cityId"  style="width:128px">
                                                <option value="" selected="selected">==下级市/区==</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            <div class="buttonBar">
                                                <button id="btnSearch" type="button" onclick="submitForm()">查询</button>
                                                <button id="btnReset" type="reset">重置</button>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </form>





                            <div style="height: 10px"></div>


                            <table class="mytable resultTable fullWidth">
                                <tr>
                                    <th style="width:30px">序号</th>
                                    <th style="width:70px">创建时间</th>
                                    <th>客户名称</th>
                                    <th style="width:70px">主联系人</th>
                                    <th>客户地址</th>
                                    <th style="width:70px">客户专员</th>
                                    <th style="width:100px">操作</th>
                                </tr>

                                <c:if test="${!empty pager.list}">
                                    <c:forEach items="${pager.list}" var="list" varStatus="vs">
                                        <tr>
                                            <td style="width:30px">${vs.index+1}</td>
                                            <td style="width:70px">${list.customer.createDate}</td>
                                            <td><a href='../customer/客户信息.html'>${list.customer.name}</a>
                                                ${list.customer.provinceName} ${list.customer.cityName} </td>
                                            <td style="width:70px">
                                                <c:if test="${list.major == true}">
                                                    ${list.name}
                                                </c:if>
                                            </td>
                                            <td>${list.customer.address}</td>
                                            <td style="width:70px">${list.customer.owner.username}</td>
                                            <td style="width:100px"><a href="../customer/拜访记录.html">拜访记录</a>
                                                <a href="../customer/联系人列表.html">联系人</a></td>
                                        </tr>
                                    </c:forEach>
                                </c:if>

                            </table>
                            <div class="pager-container">



                                <script type="text/javascript">
                                    function pager(num){
//        alert("num:"+num);
                                        document.getElementById("pageNumber").value = num;
                                        document.myForm.submit();
                                    }
                                </script>

                                <ul class="pager">
                                    <li class="pageInfo">共${pager.totalCount}条记录,
                                    <li class="pageInfo">共${pager.pageCount}页，当前为第${pager.pageNumber}页</li>
                                    <!--首页-->


                                    <li class="firstPage">
                                        <a href="${path}/customer/conflict?pager.pageNumber=1">首页</a>
                                    </li>

                                    <!--上一页-->


                                    <li class="prePage">
                                        <c:if test="${pager.pageNumber == 1}" var="isFirst">
                                            <span>上一页</span>
                                        </c:if>
                                        <c:if test="${!isFirst}">
                                            <a href="${path}/customer/conflict?pager.pageNumber=${pager.pageNumber-1}">上一页</a>
                                        </c:if>
                                    </li>

                                    <!--下一页-->


                                    <li class="nextPage">
                                        <c:if test="${pager.pageNumber == pager.pageCount}" var="isLast">
                                            <span>下一页</span>
                                        </c:if>
                                        <c:if test="${!isLast}">
                                            <a href="${path}/customer/conflict?pager.pageNumber=${pager.pageNumber+1}">下一页</a>
                                        </c:if>
                                    </li>

                                    <!--末页-->


                                    <li class="lastPage">
                                        <a href="${path}/customer/conflict?pager.pageNumber=${pager.pageCount}">末页</a>
                                    </li>

                                </ul>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </td>
    </tr>
</table>

<!--尾部-->
<div class="footer">


    <div class="seperator"></div>
    <p>
        <a href="http://www.sztzedu.com">公司主站</a>|
        <a href="#">隐私策略</a>|
        <a href="#">服务条款</a>&nbsp;
        苏州天智教育公司&reg;版权所有 2012-2015
    </p>

</div>
</body>
</html>